package com.grid.camera.examples;

import com.grid.camera.netty.DataReceiveListener;
import com.grid.camera.netty.NettyClient;
import com.grid.camera.pelco.PelcoDUtils;

public class NettyExample {

    public static void main(String[] args) throws InterruptedException {

        NettyClient nettyClient =
                new NettyClient(
                        "192.168.15.184",
                        4196,
                        new DataReceiveListener() {
                            @Override
                            public void onDataReceived(String ip, byte[] data) {

                                System.out.println("收到数据：" + PelcoDUtils.bytesToHex(data));
                                System.out.println("ip：" + ip);
                            }
                        });
        nettyClient.connect();
        nettyClient.close();

        Thread.sleep(5000);
    }
}
